package cn.scxy.bookcity.controller;

import cn.scxy.bookcity.pojo.vo.PressStandardVO;
import cn.scxy.bookcity.service.IPressService;
import cn.scxy.bookcity.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户首页的控制器
 *
 * @author zzr
 */
@RestController
@RequestMapping("/press")
@Api(tags = "出版社模块")
@Slf4j
public class PressController {
    @Autowired
    private IPressService iPressService;

    @ApiOperation("根据商品id查询出版社")
    @ApiOperationSupport(order = 300)
    @GetMapping("/{id}")
    public JsonResult<PressStandardVO> queryPress1(@PathVariable Integer id) {
        System.out.println("商品id---------" + id);
        PressStandardVO pressStandardVO = iPressService.queryPress(id);
        log.debug("查询到的结果:{}", pressStandardVO);
        return JsonResult.ok(pressStandardVO);
    }
}